#ifndef __BSP_H__
#define __BSP_H__

#include "stm32f1xx_hal.h"




typedef enum {
	FALSE = 0,
	TRUE
} BOOL;


extern BOOL vddOn;


//extern void bspInit(void);
/*
	LCM Vdd setting
*/
extern void bspSetVdd(double voltage);



/*
	LCMs On Board
*/
#define LCMCHN_SAMP 		0X01	// Sample Lcm *2
#define LCMCHN_TEST 		0X02	// Lcm To Be Test
#define LCMCHN_DISP 		0X04	// Lcm As Display
#define LCMCHN_ALL 			0Xff	// 

extern void bspLcmHWreset(uint8_t lcmChn);
extern void bspLcmSelect(uint8_t lcmChn);
extern void bspLcmRelease(uint8_t lcmChn) ;
/*
	LEDs On Board
*/
#define LEDCHN_VF1 			0x001
#define LEDCHN_CONTRAST		0x002
#define LEDCHN_VF4			0x004
#define LEDCHN_V30			0x008
#define LEDCHN_WRITTING		0x010
#define LEDCHN_V33			0x020
#define LEDCHN_V36			0x040
#define LEDCHN_G			0x080
#define LEDCHN_R			0x100

#define LEDCHN_ALL			0x1FF

extern void bspLedInit(void);
extern void bspLed(uint16_t ledChn, BOOL state);



/*
	Keys On Board
*/
#define KEYCHN_VF1 				0x001
#define KEYCHN_VF4				0x002
#define KEYCHN_INC				0x004
#define KEYCHN_DEC				0x008
#define KEYCHN_OK				0x010
#define KEYCHN_CLR				0x020

extern uint8_t bspReadKey(uint8_t keyChn);


/* 
	AD DA 
*/

extern double bspReadV0(void);
extern double bspReadIdd(void);
// V0 Vout Compare


/*
	Test Functions
*/
extern void bspTestStart(void);
extern void bspModeTest(void);






extern void lcmPowerOff(void);


#endif //__BSP_H__
